#pragma once

namespace RB
{
namespace sh_math
{
    static const int max_order = 7;
    typedef void(*rgb_reader)(const void* pixel, float* r, float* g, float* b);
    typedef void(*rgb_writer)(void* pixel, float r, float g, float b);
    
    // supported order are 1-3
    void project_cube_map(float* sh_r, float* sh_g, float* sh_b, const void* const* data, size_t pitch, size_t res, size_t pixel_size, int order, rgb_reader reader);
    void unproject_cube_map_face(const float* sh_r, const float* sh_g, const float* sh_b, void* data, int face, size_t pitch, size_t res, size_t pixel_size, int order, rgb_writer writer);
    void eval_direction  (const float* dir, float* sh, int order);
}
}
